home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / SCREEN.SWG / 0027_Changing Screen Attr.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-27  |  659b  |  25 lines

  1. {
  2. DAVID DRZYZGA
  3.  
  4. > I want to know how to get and set the screen colors Without using the
  5. > Crt Unit or ansi codes.  Any help is appreciated.
  6.  
  7. This will do what you ask. There is no checking of the vidseg since it is
  8. assumed that if you want to Write in color that you are using a color monitor:
  9. }
  10.  
  11. Procedure WriteColorAt(X, Y : Byte; St : String; Attr : Byte);
  12. Var
  13.   Count : Byte;
  14. begin
  15.   For Count := 1 to Length(St) do
  16.   begin
  17.     Mem[$B800 : 2 * (80 * (Y - 1) + X + Count - 2)] := Ord(St[Count]);
  18.     Mem[$B800 : 2 * (80 * (Y - 1) + X + Count - 2) + 1] := Attr;
  19.   end;
  20. end;
  21.  
  22. begin
  23.   WriteColorAt(34, 12, 'Hello World!', $4E);
  24. end.
  25.